<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="utf-8" />
<title>E::placeholder</title>
<meta name="description" content="CSS3参考手册之: E::placeholder" />
<meta name="keywords" content="E::placeholder, css3选择符, css3, css3参考手册" />
<meta name="author" content="Joy Du(飘零雾雨), dooyoe@gmail.com, www.doyoe.com" />
<meta name="robots" content="all" />
<!--[if lte IE 8]>
<script src="../../js/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="../../skin/article.css" />
</head>
<body>
<nav id="guide" class="g-mod">
	<div class="from">
		<a href="http://css.doyoe.com/" target="_blank">CSS3参考手册</a>
		<span>&#187;</span>
		<a href="../index.htm">选择符列表</a>
		<span>&#187;</span>
		<a href="index.htm" id="category" rel="selectors/pseudo-element" name="placeholder">伪对象选择符</a>
		<span>&#187;</span>
	</div>
	<div class="to">
		<span class="label">相关内容：</span>
		<div class="g-combobox g-transition">
			<a href="?" class="g-transition target">
				<strong>其它伪对象选择符</strong>
				<span>选择其它项<!--[if lte IE 7]><ins>IE7 and earlier, Get to die</ins><![endif]--></span>
			</a>
			<div class="g-transition list">
				<ul>
					<!-- 插入分类快速导航 -->
				</ul>
			</div>
		</div>
	</div>
</nav>
<header id="hd">
	<section id="title" class="g-mod">
		<h1 class="tit">E::placeholder</h1>
		<ul class="info">
			<li><strong>版本：CSS3</strong></li>
		</ul>
		<!-- 插入浏览器信息 -->
	</section>
</header>
<section id="bd">
	<section id="syntax" class="g-mod g-attr">
		<h2 class="tit">语法：</h2>
		<div class="cont">
			<p><strong>E::placeholder</strong> { sRules }</p>
		</div>
	</section>
	<section id="intro" class="g-mod g-attr">
		<h2 class="tit">说明：</h2>
		<div class="cont">
			<strong>设置对象文字占位符的样式。</strong>
			<ul>
				<li>::placeholder 伪元素用于控制表单输入框占位符的外观，它允许开发者/设计师改变文字占位符的样式，默认的文字占位符为浅灰色。</li>
				<li>当表单背景色为类似的颜色时它可能效果并不是很明显，那么就可以使用这个伪元素来改变文字占位符的颜色。</li>
				<li class="g-color-light">需要注意的是，除了Firefox是 ::[prefix]placeholder，其他浏览器都是使用 ::[prefix]input-placeholder</li>
				<li>Firefox支持该伪元素使用<a href="../../properties/user-interface/text-overflow.htm">text-overflow</a>属性来处理溢出问题。</li>
				<li>
					<div class="gquote">
						<p class="gquote-tit"><strong>::placeholder的使用示例:</strong></p>
						<blockquote class="gquote-cont"><code><xmp><input type="text" placeholder="占位符" />

input::-webkit-input-placeholder {
	color: #999;
}
input:-ms-input-placeholder { // IE10+
	color: #999;
}
input:-moz-placeholder { // Firefox4-18
	color: #999;
}
input::-moz-placeholder { // Firefox19+
	color: #999;
}</xmp></code>
						</blockquote>
					</div>
				</li>
			</ul>
		</div>
	</section>
	<section id="compatible" class="g-mod g-attr">
		<h2 class="tit">兼容性：</h2>
		<div class="cont">
			<ul class="support-type">
				<li><span class="support">浅绿</span> = 支持</li>
				<li><span class="unsupport">红色</span> = 不支持</li>
				<li><span class="partsupport">粉色</span> = 部分支持</li>
			</ul>
			<table class="g-data">
				<thead>
					<tr>
						<th>IE</th>
						<th>Firefox</th>
						<th>Chrome</th>
						<th>Safari</th>
						<th>Opera</th>
						<th>iOS Safari</th>
						<th>Android Browser</th>
						<th>Android Chrome</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td class="unsupport">6.0-9.0</td>
						<td class="unsupport">2.0-3.6</td>
						<td class="partsupport" rowspan="3">4.0-43.0<br /><sup class="fix">-webkit-</sup></td>
						<td class="unsupport">3.1-4.0</td>
						<td class="partsupport" rowspan="3">15.0-28.0<br /><sup class="fix">-webkit-</sup></td>
						<td class="unsupport">3.2-4.1</td>
						<td class="partsupport" rowspan="3">2.1-4.4.4<br /><sup class="fix">-webkit-</sup></td>
						<td class="partsupport" rowspan="3">18.0-40.0<br /><sup class="fix">-webkit-</sup></td>
					</tr>
					<tr>
						<td class="partsupport" rowspan="2">10.0-11.0<br /><sup class="fix">-ms-</sup></td>
						<td class="partsupport">4.0-18.0<br /><sup class="fix">-moz-</sup> <sup><a href="#support1">#1</a></sup></td>
						<td class="partsupport" rowspan="2">5.0-8.1<br /><sup class="fix">-webkit-</sup></td>
						<td class="partsupport" rowspan="2">4.3-8.1<br /><sup class="fix">-webkit-</sup></td>
					</tr>
					<tr>
						<td class="partsupport">19.0-38.0<br /><sup class="fix">-moz-</sup></td>
					</tr>
				</tbody>
			</table>
			<ol class="support-info">
				<li id="support1">::-moz-placeholder 伪元素在Firefox 19+替代了之前的 :-moz-placeholder 伪类</li>
			</ol>
		</div>
	</section>
	<section id="example" class="g-mod g-attr">
		<h2 class="tit">示例：</h2>
		<div class="cont">
			<textarea cols="90" rows="10">
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="utf-8" />
<title>E::placeholder_CSS参考手册_web前端开发参考手册系列</title>
<meta name="author" content="Joy Du(飘零雾雨), dooyoe@gmail.com, www.doyoe.com" />
<style>
input::-webkit-input-placeholder {
	color: green;
}
input:-ms-input-placeholder { // IE10+
	color: green;
}
input:-moz-placeholder { // Firefox4-18
	color: green;
}
input::-moz-placeholder { // Firefox19+
	color: green;
}
</style>
</head>
<body>

  <input id="test" placeholder="Placeholder text!">

</body>
</html>
			</textarea>
			<p><input type="button" value="运行" class="g-btn g-btn-sure" /></p>
		</div>
	</section>
</section>
<footer id="ft">
	<aside id="rights" class="g-mod">
		<!-- 插入浏览器及版权信息 -->
	</aside>
</footer>
<script src="../../js/jquery.js"></script>
<script src="../../js/inner.js"></script>
</body>
</html>